home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / dtl / example.tex < prev    next >
Text File  |  1992-09-04  |  10KB  |  233 lines

  1. % This is the TeX source file for the "TeXnical Typesetting" document.
  2. % Notice how you can put in comments?  If TeX sees a % it simply ignores
  3. % the rest of the line.
  4.  
  5. % A4 paper is 8.3in wide and 11.7in high; we set the page dimensions so that
  6. % there are 1in margins all around:
  7. \hsize 6.3in                           % page width
  8. \vsize 9.7in                           % page height
  9.  
  10. \parskip 8pt plus 2pt minus 1pt        % glue before a paragraph
  11.  
  12. % Define a few extra fonts for later use:
  13. \font\bigrm=cmr10 scaled\magstep4      % big version of the standard roman font
  14. \font\ninerm=cmr9                      % 9pt roman
  15. \font\fiverm=cmr5                      % 5pt roman
  16. \font\sm=cmcsc10                       % caps and small caps
  17. \font\ss=cmss10                        % sans serif
  18.  
  19. % Here's a macro that we'll use to produce all subheadings:
  20. \def\subhead#1{\bigskip                % extra glue before subheading
  21.                \noindent{\bf #1}\par   % unindented boldface subheading
  22.                \nobreak}               % prevent a page break after subheading
  23.  
  24. \centerline{\bigrm \TeX nical Typesetting}
  25.  
  26. \vskip 2.5cm                           % dimensions can be metric
  27.  
  28. \subhead{What is \TeX?}
  29.  
  30. \TeX\ (pronounced ``teck'') is a computerized typesetting system developed by
  31. Donald Knuth and others at Stanford University.  It is used to create
  32. high-quality documents, particularly those containing mathematics.
  33. The name \TeX\ is an uppercase form of the Greek letters $\tau\epsilon\chi$,
  34. the first three letters of a Greek word meaning {\sl art} as well as
  35. {\sl technology}.
  36. The lowering of the ``E'' is a reminder that \TeX\ is about typesetting,
  37. which can be thought of as the next stage beyond word processing.
  38. On devices where such lowering is difficult or impossible you may see \TeX\
  39. written as {\tt TeX}.
  40.  
  41. % the above blank line ends the first paragraph
  42.  
  43. Most word processors allow you to
  44. create and modify a document interactively --- what
  45. you see on the screen is usually what your output will look like.
  46. \TeX\ does {\it not} work in this way.
  47. Like other typesetting systems (such as SCRIBE and
  48. {\sl troff\/}), \TeX\ is known as a ``document compiler''.  Using your
  49. favourite text editor you need to create a file containing the
  50. text of your manuscript along with the \TeX\ typesetting commands.
  51. \TeX\ gives you the ability to produce printed matter with a quality
  52. matching that found in books, depending on the output device.
  53. Adelaide University has an {\sm imagen} laser printer
  54. with a resolution of 240 dots per inch.
  55. This publication shows both the capabilities of \TeX\ and
  56. the output quality of the laser printer.
  57.  
  58. \subhead{Fonts}
  59.  
  60. One of the more obvious advantages of \TeX\ is the large range of fonts from
  61. which you can choose.  A font is a collection of characters each having a
  62. similar size and style.  Some of the fonts currently available include:
  63. $$        % enter display math mode just to get space above and below \line
  64. \line
  65.   {\hfil  % infinitely stretchable glue
  66.    \rm roman\hfil  \sl slanted\hfil  \it italic\hfil  \bf boldface\hfil
  67.    \tt typewriter\hfil  \ss sans serif\hfil  \sm small caps\hfil
  68.   }       % take care to ensure each { has a matching }
  69. $$
  70. Many of these also come in a variety of sizes:
  71. $$
  72. \centerline{{\bigrm from the very big},~         % extra space after comma
  73.               {\ninerm to the very small},~
  74.                 {\fiverm to the ridiculous}.}
  75. $$
  76. Apart from a large selection of mathematical symbols,
  77. many special characters and accents are available:
  78. $$
  79. \vbox
  80.   {\tabskip 10pt plus 1fil   % glue before and after all columns
  81.    \halign to\hsize
  82.      {& \hfil#\hfil\cr       % specify a variable number of centred columns
  83.       \copyright& \it\$& \S& \P& \dag& \ddag&
  84.         $\circ$& $\bigcirc$&   % some symbols must be accessed from math mode
  85.           $\leftarrow$& $\rightarrow$& $\triangle$& $\clubsuit$&
  86.             \`a& \'e& \c c& \^o& \"u\cr
  87.      }
  88.   }
  89. $$
  90. \TeX\ does a few subtle things automatically.
  91. Certain sequences of characters in your text will
  92. be replaced by {\sl ligatures} in the printed output (consider the ``{\tt ffi}''
  93. in ``difficult''), while other pairs of characters need to be {\sl kerned}
  94. (e.g., the ``o'' and ``x'' in ``box'' look better if they are moved closer
  95. together).  The range and quality of fonts available will continue to improve.
  96.  
  97. \subhead{Mathematics}
  98.  
  99. A major design goal of \TeX\ was to simplify the task of typesetting
  100. mathematics --- and to do it properly.  Mathematicians will be pleasantly
  101. surprised at the ease with which formulae and expressions can be created;
  102. from simple in-line equations
  103. such as $e^{i\pi}=-1$ and $f_{n+2}=f_{n+1}+f_n$, to more extravagant displays:
  104. $$
  105. \sum_{k\ge1} \sqrt{x_k-\ln k}\quad\ne\quad
  106. \int_{0}^\infty {e^{-x^3}+\sqrt{x} \over \left(123-x\right)^3} \,dx
  107. $$
  108. \TeX\ looks after most of the nitty gritty details, such as spacing things
  109. correctly and choosing the right sizes for superscripts, parentheses,
  110. square root signs etc.  (The discoverer of the above relation wishes to
  111. remain anonymous.)
  112.  
  113. \subhead{Alignment}
  114.  
  115. The preparation of tabular material such as in lists and matrices can be a
  116. tedious job for a person armed only with a typewriter and a bottle of
  117. correction fluid.  With a little help from \TeX, computers can make it so
  118. much easier:
  119. $$
  120. \vcenter                               % a vertically centred \vbox
  121.   {\tabskip 0pt                        % no space before column 1
  122.    \halign to 3.5in                    % width of table
  123.      {\strut#&                         % col 1 is a strut
  124.        \vrule#\tabskip .5em plus2em&   % col 2 is a vrule; also set col spacing
  125.         #\hfil&                        % col 3 is left justified
  126.          \vrule#&                      % col 4 is a vrule
  127.           \hfil#\hfil&                 % col 5 is centred
  128.            \vrule#&                    % col 6 is a vrule
  129.             \hfil#&                    % col 7 is right justified
  130.              \vrule#\tabskip 0pt       % col 8 is a vrule; no space after it
  131.               \cr                      % end of the preamble
  132.       \noalign{\hrule}
  133.       & & \multispan5 \hfil Oldest players to represent\hfil& \cr
  134.       & & \multispan5 \hfil England in a Test Match\hfil& \cr
  135.       \noalign{\hrule}
  136.       & & \omit\hfil Name\hfil& &      % \omit ignores template in preamble
  137.             \omit\hfil Age\hfil& &
  138.               \omit\hfil Versus\hfil& \cr
  139.       \noalign{\hrule}
  140.       & & W.Rhodes& & 52y 165d& & West Indies, 1930& \cr
  141.       \noalign{\hrule}
  142.       & & W.G.Grace& & 50y 320d& & Australia, 1899& \cr
  143.       \noalign{\hrule}
  144.       & & G.Gunn& & 50y 303d& & West Indies, 1929& \cr
  145.       \noalign{\hrule}
  146.       & & J.Southerton{\ninerm*}& & 49y 139d& & Australia, 1877& \cr
  147.       \noalign{\hrule\smallskip}
  148.       & \multispan7\ninerm* (This was actually his Test debut.)\hfil \cr
  149.      }
  150.   }
  151. \hskip .5in           % space between table and matrix
  152. A=\pmatrix            % parenthesized matrix
  153.     {a_{11}& a_{12}& \ldots& a_{1n}\cr
  154.      a_{21}& a_{22}& \ldots& a_{2n}\cr
  155.      \vdots& \vdots& \ddots& \vdots\cr
  156.      a_{m1}& a_{m2}& \ldots& a_{mn}\cr
  157.     }
  158. $$
  159.  
  160. \vskip -\the\belowdisplayskip      % avoid too much space below display
  161.  
  162. \subhead{Other features}
  163.  
  164. Space does not permit examples of all the things \TeX\ can do.  Here are some
  165. more features you might like to know about:
  166.  
  167. \item{$\bullet$}
  168. Multi-column output can be generated.
  169.  
  170. {\parskip=0pt       % temporarily turn off the skipping between paragraphs
  171. \item{$\bullet$}
  172. \TeX\ has a very sophisticated paragraph building algorithm and rarely needs
  173. to resort to hyphenation.  Paragraphs can be indented and shaped in many
  174. different ways.
  175.  
  176. \item{$\bullet$}
  177. Automatic insertion of footnotes,\footnote{\dag}{\ninerm Here is
  178. a footnote.} running heads, page numbers etc.
  179.  
  180. \item{$\bullet$}
  181. \TeX\ makes provision for generating a table of contents, a bibliography, even
  182. an index.  Automatic section numbering and cross referencing are also possible.
  183.  
  184. \item{$\bullet$}
  185. A powerful macro facility is built into \TeX.  This lets you do some very
  186. useful things, like creating an abbreviation for a commonly used phrase, or
  187. defining a new command that will have varying effects depending on the
  188. parameters it is given.  A macro package can enhance \TeX\ by making it much
  189. easier to generate a document in a predefined format.
  190. \par                % end the last paragraph BEFORE ending the group
  191. }                   % \parskip will now revert to its previous value
  192.  
  193. \subhead{What CAN'T \TeX\ do?}
  194.  
  195. Complex graphics such as diagrams and illustrations pose
  196. a major problem --- at the moment you have to leave an appropriate amount of
  197. blank space and paste them in later.
  198. Graphic facilities are the subject of current research.
  199.  
  200. \subhead{\TeX\ and VAX/VMS}
  201.  
  202. The \TeX\ source file used to generate this document is available for
  203. inspection on any VAX node that has \TeX ---
  204. just type `{\tt scroll tex\char'137 inputs:example.tex}'.
  205. A few steps are needed to print such a file:
  206.  
  207. \item{(1)}
  208. Type `{\tt tex example}' to ``compile'' the file.
  209. (\TeX\ looks for a {\tt .tex} file by default.  If it can't find the given
  210. file in your current directory it will look in {\tt tex\char'137 inputs}.)
  211. Two new files will be created in your current directory:
  212. {\tt example.dvi} and {\tt example.lis}.
  213. The former is a device independent description of the document;
  214. the latter is simply a log of the \TeX\ run.
  215.  
  216. {\parskip=0pt    % temporarily turn off \parskip
  217. \item{(2)}
  218. Type `{\tt dvitovdu example}' to preview the document on a terminal screen.
  219. This program can be used to detect a variety of formatting problems,
  220. saving both time and paper.
  221.  
  222. \item{(3)}
  223. Type `{\tt imprint example}' to print the document.
  224. (Note that the DVIto\kern-.15em VDU and IMPRINT commands
  225. accept a {\tt .dvi} file by default).
  226.  
  227. }                % restore \parskip
  228.  
  229. Detailed help on all these commands is available on-line --- try typing
  230. `{\tt help tex}' to get started.
  231.  
  232. \bye
  233.